console.log(Buffer.byteLength('test'));//返回字符串占几个字节
console.log(Buffer.byteLength('测试'));

console.log(Buffer.isBuffer({}));
console.log(Buffer.isBuffer(Buffer.from([1,2,3])))//判断  是否为  buffer对象

const buf1=Buffer.from('this ');
const buf2=Buffer.from('is ');
const buf3=Buffer.from('a ');
const buf4=Buffer.from('test ');
const buf5=Buffer.from('!');

const buf=Buffer.concat([buf1,buf2,buf3,buf4,buf5]);

console.log(buf.toString())